/*
 * Copyright 2013 MovingBlocks
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cola.machine.game.myblocks.entitySystem.prefab.internal;

/**
 * @author Immortius <immortius@gmail.com>
 */
public class PojoPrefab {
//        extends Prefab {
//
//    private Prefab parent;
//    private Map<Class<? extends Component>, Component> componentMap;
//    private List<Prefab> children = Lists.newArrayList();
//    private boolean persisted;
//    private boolean alwaysRelevant = true;
//
//    public PojoPrefab(AssetUri uri, PrefabData data) {
//        super(uri);
//        reload(data);
//    }
//
//    @Override
//    public Prefab getParent() {
//        return parent;
//    }
//
//    @Override
//    public List<Prefab> getChildren() {
//        return ImmutableList.copyOf(children);
//    }
//
//    @Override
//    public boolean isPersisted() {
//        return persisted;
//    }
//
//    @Override
//    public boolean isAlwaysRelevant() {
//        return alwaysRelevant;
//    }
//
//    @Override
//    public boolean exists() {
//        return true;
//    }
//
//    @Override
//    public boolean hasComponent(Class<? extends Component> component) {
//        return componentMap.containsKey(component);
//    }
//
//    @Override
//    public <T extends Component> T getComponent(Class<T> componentClass) {
//        return componentClass.cast(componentMap.get(componentClass));
//    }
//
//    @Override
//    public Iterable<Component> iterateComponents() {
//        return ImmutableList.copyOf(componentMap.values());
//    }
//
//    @Override
//    public void dispose() {
//    }
//
//    @Override
//    public void reload(PrefabData data) {
//        this.componentMap = ImmutableMap.copyOf(data.getComponents());
//        this.persisted = data.isPersisted();
//        this.alwaysRelevant = data.isAlwaysRelevant();
//        this.parent = data.getParent();
//        if (parent != null && parent instanceof PojoPrefab) {
//            ((PojoPrefab) parent).children.add(this);
//        }
//    }
//
//    @Override
//    public boolean isDisposed() {
//        return false;
//    }
}
